﻿<!--
Provided for Informational Purposes Only

Apache 2.0 License

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 

THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY 
IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR 
PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing
permissions and limitations under the License.
	-->
<common:LayoutAwarePage
	x:Name="pageRoot"
	x:Class="ContractMeow.ModernApp.Views.ContractCreatedView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="using:ContractMeow.ModernApp.Views"
	xmlns:common="using:ContractMeow.ModernApp.Common"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d">

	<Page.Resources>
		<Style TargetType="TextBlock">
			<Setter Property="FontSize" Value="56"/>
			<Setter Property="Foreground" Value="#404040"/>
		</Style>
	</Page.Resources>

	<Grid Style="{StaticResource LayoutRootStyle}">
		<Grid.RowDefinitions>
			<RowDefinition Height="140"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!-- Back button and page title -->
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="Auto"/>
			</Grid.ColumnDefinitions>
			<Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
			<TextBlock x:Name="pageTitle" Grid.Column="1" Text="My contracts" Style="{StaticResource PageHeaderTextStyle}"/>
			<StackPanel Grid.Column="2" Background="LightGray" Style="{StaticResource CurrentUserHeaderPanel}">
				<Image Source="{Binding CurrentUser.MugshotUrl}" Style="{StaticResource CurrentUserImage}"/>
				<TextBlock Text="{Binding CurrentUser.FullName}" Style="{StaticResource CurrentUserText}"/>
			</StackPanel>
		</Grid>

		<StackPanel Grid.Row="1"
					HorizontalAlignment="Center">
			<StackPanel Orientation="Horizontal"
						HorizontalAlignment="Center"
					Margin="0, 150, 0, 0"
					>

				<TextBlock Text="Your contract for"/>

				<TextBlock Text="{Binding Title}"
					   Margin="12, 0"
					   Foreground="#00BCF2"/>

				<TextBlock Text="was created :-)"/>
			</StackPanel>

			<StackPanel Orientation="Horizontal"
						HorizontalAlignment="Center">
				<TextBlock Text="{Binding AssigneesCount}"
						   Foreground="#00BCF2"/>
				<TextBlock Text=" people have been assigned on Yammer."/>
			</StackPanel>
		</StackPanel>

			<VisualStateManager.VisualStateGroups>

				<!-- Visual states reflect the application's view state -->
				<VisualStateGroup x:Name="ApplicationViewStates">
					<VisualState x:Name="FullScreenLandscape"/>
					<VisualState x:Name="Filled"/>

					<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
					<VisualState x:Name="FullScreenPortrait">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
								<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>

					<!-- The back button and title have different styles when snapped -->
					<VisualState x:Name="Snapped">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
								<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
								<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
	</Grid>
</common:LayoutAwarePage>
